__author__ = 'DSperansky'

from php4dvd.pages.internal_page import InternalPage
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec

class MovieInfoPage(InternalPage):

    @property
    def remove_button(self):
        delete_button_css_locator = "nav li:last-of-type>div.button img"
        return self.wait.until(ec.visibility_of_element_located((By.CSS_SELECTOR, delete_button_css_locator)))

    @property
    def is_this_page(self):
        current_url = str(self.driver.current_url)
        if current_url.count('=') == 2:
            url_split = current_url.split('=')
            if url_split[2].isdigit():
                return True
            return False
        return False
